gtk-demo: Handle GDK_TOUCH_CANCEL in event-axes demo
authorCarlos Garnacho <carlosg@gnome.org>
Mon, 14 Mar 2016 14:28:20 +0000 (15:28 +0100)
committerCarlos Garnacho <carlosg@gnome.org>
Mon, 14 Mar 2016 14:30:27 +0000 (15:30 +0100)
It is a thing in wayland, which means we leave traces from older
touches when the compositor takes over touch sequences in order
to handle a gesture.

demos/gtk-demo/event_axes.c

index bc31f5330842199803f40ff0d6d6305b70f62b25..bfec8b7fafd1647df232101504942ff33fe377a1 100644 (file)
@@ -131,7 +131,8 @@ update_axes_from_event (GdkEvent  *event,
   source_device = gdk_event_get_source_device (event);
   sequence = gdk_event_get_event_sequence (event);
 
-  if (event->type == GDK_TOUCH_END)
+  if (event->type == GDK_TOUCH_END ||
+      event->type == GDK_TOUCH_CANCEL)
     {
       g_hash_table_remove (data->touch_info, sequence);
       return;